package hn.sigit.test;

import java.math.BigDecimal;
import java.util.Scanner;

import hn.sigit.util.GeneralUtils;

import org.jboss.seam.mock.SeamTest;
import org.testng.annotations.Test;

public class ConvertNumberToWords extends SeamTest {
	@Test
	public void convert() {
		String str;
		Scanner scanner = new Scanner(System.in);

		try {
			do {
				System.out.print(" > ");
				str = scanner.nextLine();
				BigDecimal bd = BigDecimal.valueOf(Double.valueOf(str));
				String txt = GeneralUtils.spanishConvertNumberToWords(bd, "lempira(s)", "con", "centavo(s)");
				
				System.out.println("El numero es: " + txt);
			} while (true);
		}
		catch (NumberFormatException e) {
			System.out.println("Test finished!");
		}
		
		assert true;
	}
	
	public static void main(String[] args) {
		new ConvertNumberToWords().convert();
	}
}
